/** 
  Copyright (c) 2008, 2009 Claudio Imbrenda
  This program is released under the terms of the
  GNU GPL version 3 or later.
*/
package macchina;

public interface AdattatoreEntrata{

/** End Of Tape.
 */
public static final byte EOT = 32;

/** Unreadable character.
 */
public static final byte IOERR = 64;

/** Gets the next 5 bit character from the paper tape.
 * Should return values in the range [0..31] or 32 or 64, with 32 meaning 
 * end of tape, and 64 meaning symbol unreadable or tape damaged. Note that 
 * 64 does not mean that further reads will be errors, it only means that the
 * next character is unreadable, so callers of read() should not assume that
 * the tape has finished until 32 is returned.
 * If an unrecoverable read error occourred, 96 (32|64) should be returned.
 * Note that 32 and 64 will be read as 0 by the machine.
 * @return a character value in the range [0..31] or 32 for end of tape, 64 for 
 *    read error, and 96 for unrecoverable read error.
 */
public byte read();

/**
 * Sets the paper tape to a loop. A circular tape will never end.
 * @param v true to set the tape in a loop, false to unloop it.
 */
public void setLoop(boolean v);

/**
 * Returns the loop status for this tape
 * @return true if this paper tape is a loop, false otherwise.
 */
public boolean isLoop();

}
